<?php
/**
     * 微信卡券：消耗卡券
     */
defined('BY_JYA') or exit('error');
list($code, $card_id = '')=$arguments;
		$jsonData = '{"code":"' . $code . '"';

		if (!empty($card_id)) {
			$jsonData .= ',"card_id":"' . $card_id . '"';
		}

		$jsonData .= '}';
		$token =  cfc('account')->getAccessToken();
		$url = 'https://api.weixin.qq.com/card/code/consume?access_token=' . $token;
		$result = cfc('http')->ihttp_post($url, $jsonData);
		$result =@json_decode($result['content'],true);
		return $result;